<#import '/ftlLibrary/properteisVariable.ftl' as pv/>
<link href="assets/css/bootstrap-select.css" rel="stylesheet"/>
<link href="assets/css/front/listCommonStyle.css" rel="stylesheet"/>
<link href="assets/css/modify.css" rel="stylesheet"/>
<script src="assets/js/select2/select2.js"></script>
<style>
    .iconchange1 .fa{
        color: #2a6496;
        font-size: 12px!important;
    }
    .tssStudentEditDialog .modal-dialog {
        width: 60% !important;
    }
</style>
<div class="row margin-left-10">
    <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
        <div class="widget flat margin-top-0" style="margin: -10px 0 0px 0!important;">
            <div class="widget-header bordered-sky theme-bordered nopadding">
                <div class="widget-buttons widget-label nomargin-bottom">
                    <label class="businessBtns">
                        <ol class="breadcrumb" style="margin: 0;">
                            <li style="color: #809fa6;">客户管理</li>
                            <li class="active" style="color: #23a8f5;">客户名单</li>
                        </ol>
                    </label>
                </div>
            </div>
        </div>
    </div>
    <!-- 映射列表 -->
    <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
        <div class="widget flat searchCriteria" style="margin: 0;">
            <div class="widget-header bordered-sky theme-bordered nopadding">
                <div class="widget-buttons " style="margin-bottom: 10px !important;">
                    <!-- 业务按钮 begin -->
                    <label class="businessBtns float-left">
                        <a type="btn" class="btn basicInfoBtnt"
                               href="javascript:toView('tssStudentController/tssStudentList.do',true,'POST',{pageSize:10})"
                               style="background-color: #23a8f5;border: none;border-radius: 4px!important;width: 120px;color: #fff;box-shadow:0px 0px 10px rgba(122,161,184,0.3);">客户名单</a>
                    </label>
                    <label class="businessBtns float-right">
                        <label>
                          <!--  <a style="border-radius: 0px;border: none;background: #ffab00 !important;" class="btn btn-warning shiny add "
                                    serializeNum="${serializeNum}" editUrl="${editUrl}"><i class="fa fa-plus"></i>新增
                            </a>-->
                            <@hp code="KHMD24277389291454-list_add"
                            params="[serializeNum=${serializeNum}]"/>
                        </label>
                        <label>
                            <@hp code="KHMD24277389291454-batch_allocationAdd"
                            params="[serializeNum=${serializeNum}]"/>
                        </label>
                        <label>
                            <@hp code="KHMD24277389291454-exportData"  params="[searchFormId=${searchFormId}]" />
                        </label>
                        <label >
                            <@hp code="KHMD24277389291454-importData" />
                        </label>
                        <label>
                            <a style="border-radius: 0px;border: none;background: #ffab01 !important;"
                               class="btn btn-warning shiny search "><i
                                    class="fa fa-search"></i>搜索
                            </a>
                        </label>
                        <label onclick="iconsChange()" >
                            <label>
                                <a class="iconsChangeA" style="width: 13px;height: 13px;cursor: pointer;background: url('assets/img/nav-img/icon_hidden.png');display: block;-webkit-user-select:none; -moz-user-select:none; -ms-user-select:none;user-select:none;" value="1"></a>
                            </label>
                            <label style="color: #23a8f5 ;vertical-align: middle;padding-top:4px;">
                                <span class="iconsChangeSpan" style="-webkit-user-select:none; cursor: pointer;-moz-user-select:none; -ms-user-select:none;user-select:none;">隐藏搜索栏</span>
                            </label>
                        </label>
                    </label>
                    <!-- 业务按钮 end -->
                </div>
            </div>
        </div>
        <div class="search_Bar" style="vertical-align: middle;clear: both;">
            <form id="${searchFormId}" action="${actionUrl}" class="searchConditions" method="POST">
                <div class="row searchInput" style="margin: 0;">
                    <label class="iconchange1 hidden" style="position: absolute;right: 10px;top: 50px;" >
                        <a class="search_Bar_A" id="iconchangemore" style="color: #2a6496;cursor: pointer;" onclick="iconchangeShow(this)" value="1">筛选更多<i class="fa fa-chevron-down" style="padding-left: 5px"></i></a>
                    </label>
                    <label style="margin-bottom: 15px;margin-right: 40px;" class="search_Bar_item hidden">
                        <label style="width: 78px">客户姓名：</label>
                        <label>
                            <input type="text" name="name" value="${search_map.name[0]}" style="width: 200px;height: 30px;border: 1px solid #c6d5d8;border-radius: 4px !important;">
                        </label>
                    </label>
                    <label style="margin-bottom: 15px;margin-right: 40px;" class="search_Bar_item hidden">
                        <label style="width: 78px">客户昵称：</label>
                        <label>
                            <input type="text" name="nickName" value="${search_map.nickName[0]}" style="width: 200px;height: 30px;border: 1px solid #c6d5d8;border-radius: 4px !important;">
                        </label>
                    </label>
                    <label style="margin-bottom: 15px;margin-right: 40px;" class="search_Bar_item hidden">
                        <label style="width: 78px">联系电话：</label>
                        <label>
                            <input type="text" name="contactPhone" value="${search_map.contactPhone[0]}" style="width: 200px;height: 30px;border: 1px solid #c6d5d8;border-radius: 4px !important;">
                        </label>
                    </label>
                    <label style="margin-bottom: 15px;margin-right: 40px;" class="search_Bar_item hidden">
                        <label style="width: 78px">客户年龄：</label>
                        <label>
                            <select class="form-select-1" style="width: 90px;height: 30px;border: 1px solid #c6d5d8;border-radius: 4px !important;padding-left: 0px!important;padding-right: 0px!important;" name="age_begin" >
                                <option value="">请选择</option>
                                <@dictionary groupCode="stuAge";dics>
                                <#list dics as dic>
                                <option value="${dic.code}">${dic.value}</option>
                            </#list>
                        </@dictionary>
                        </select>
                        至
                        <select class="form-select-1" style="width: 90px;height: 30px;border: 1px solid #c6d5d8;border-radius: 4px !important;padding-left: 0px!important;padding-right: 0px!important;" name="age_end" >
                            <option value="">请选择</option>
                            <@dictionary groupCode="stuAge";dics>
                            <#list dics as dic>
                            <option value="${dic.code}">${dic.value}</option>
                        </#list>
                    </@dictionary>
                    </select>
                    </label>
                    </label>
                    <label style="margin-bottom: 15px;margin-right: 40px;" class="search_Bar_item hidden">
                        <label style="width: 78px">客户状态：</label>
                        <label>
                            <select class="form-select-1" style="width: 200px;height: 30px;border: 1px solid #c6d5d8;border-radius: 4px !important;" name="stuStatus" >
                                <option value="">请选择</option>
                                <@dictionary groupCode="stuStatus";dics>
                                    <#list dics as dic>
                                        <option value="${dic.code}">${dic.value}</option>
                                    </#list>
                                </@dictionary>
                            </select>
                        </label>
                    </label>
                    <label style="margin-bottom: 15px;margin-right: 40px;" class="search_Bar_item hidden">
                        <label style="width: 78px">名单状态：</label>
                        <label>
                            <select class="form-select-1" style="width: 200px;height: 30px;border: 1px solid #c6d5d8;border-radius: 4px !important;" name="listStatus">
                                <option value="">请选择</option>
                                <@dictionary groupCode="listStatus";dics>
                                    <#list dics as dic>
                                        <option value="${dic.code}">${dic.value}</option>
                                    </#list>
                                </@dictionary>
                            </select>
                        </label>
                    </label>
                    <label style="margin-bottom: 15px;margin-right: 40px;" class="search_Bar_item hidden">
                        <label style="width: 78px">所属顾问：</label>
                        <label>
                            <select id="realName"  class="form-select-1" style="width: 200px;height: 30px;border: 1px solid #c6d5d8;border-radius: 4px !important;" name="realName">
                                <option value="">请选择</option>
                            </select>
                        </label>
                    </label>
                    <label style="margin-bottom: 15px;margin-right: 40px;" class="search_Bar_item hidden">
                        <label style="width: 78px">录入日期：</label>
                        <label>
                            <input id="d4313" type="text" name="updateTime_begin" class="beginValue Wdate" value="${search_map.updateTime_begin[0]}"
                                   onFocus="WdatePicker({doubleCalendar:true,maxDate:'#F{$dp.$D(\'d4314\')}',dateFmt:'yyyy-MM-dd'})" style="width: 90px;height: 30px!important;padding-left:3px!important;border: 1px solid #c6d5d8;border-radius: 4px !important;"> 至
                            <input id="d4314"  type="text" name="updateTime_end" class="endValue Wdate"  value="${search_map.updateTime_end[0]}"
                                   onFocus="WdatePicker({doubleCalendar:true,minDate:'#F{$dp.$D(\'d4313\')}',dateFmt:'yyyy-MM-dd'})" style="width: 90px;height: 30px!important;padding-left:3px!important;border: 1px solid #c6d5d8;border-radius: 4px !important;">
                        </label>
                    </label>
                    <label style="margin-bottom: 15px;margin-right: 40px;" class="search_Bar_item hidden">
                        <label style="width: 78px">沟通日期：</label>
                        <label>
                            <input id="d4315" type="text" name="followUpTime_begin" class="beginValue Wdate" value="${search_map.followUpTime_begin[0]}"
                                   onFocus="WdatePicker({doubleCalendar:true,maxDate:'#F{$dp.$D(\'d4316\')}',dateFmt:'yyyy-MM-dd'})" style="width: 90px;height: 30px!important;padding-left:3px!important;border: 1px solid #c6d5d8;border-radius: 4px !important;"> 至
                            <input id="d4316"  type="text" name="followUpTime_end" class="endValue Wdate"  value="${search_map.followUpTime_end[0]}"
                                   onFocus="WdatePicker({doubleCalendar:true,minDate:'#F{$dp.$D(\'d4315\')}',dateFmt:'yyyy-MM-dd'})" style="width: 90px;height: 30px!important;padding-left:3px!important;border: 1px solid #c6d5d8;border-radius: 4px !important;">
                        </label>
                    </label>
                    <label style="margin-bottom: 15px;margin-right: 40px;" class="search_Bar_item hidden">
                        <label style="width: 78px">转入日期：</label>
                        <label>
                            <input id="d4317" type="text" name="allocationTime_begin" class="beginValue Wdate" value="${search_map.allocationTime_begin[0]}"
                                   onFocus="WdatePicker({doubleCalendar:true,maxDate:'#F{$dp.$D(\'d4318\')}',dateFmt:'yyyy-MM-dd'})" style="width: 90px;height: 30px!important;padding-left:3px!important;border: 1px solid #c6d5d8;border-radius: 4px !important;"> 至
                            <input id="d4318"  type="text" name="allocationTime_end" class="endValue Wdate"  value="${search_map.allocationTime_end[0]}"
                                   onFocus="WdatePicker({doubleCalendar:true,minDate:'#F{$dp.$D(\'d4317\')}',dateFmt:'yyyy-MM-dd'})" style="width: 90px;height: 30px!important;padding-left:3px!important;border: 1px solid #c6d5d8;border-radius: 4px !important;">
                        </label>
                    </label>
                </div>
            </form>
        </div>
        <div class="widget flat radius-bordered" style="margin-top: 0;box-shadow:0px 0px 10px rgba(122,161,184,0.3);">
            <div class="widget-body no-padding">
                <div class="topPagingBar hidden">
                    ${pagingBar}
                </div>
                <div class="table-scrollable" style="border: none;" id="tableScrollable">
                    <!-- 数据表列信息列表 -->
                    <table class="table table-hover dataTable newtable">
                        <thead>
                        <tr>
                            <th title="选择" class="checkboxColumnTh">
                                <div class="checkbox">
                                    <label>
                                        <input type="checkbox" class="chkAll" onclick="chkAll()">
                                        <span class="text"></span>
                                    </label>
                                </div>
                            </th>
                            <th title="属性名">序号</th>
                            <th style="text-align: center">操作</th>
                            <th title="客户姓名">客户姓名</th>
                            <th title="会员昵称">会员昵称</th>
                            <th title="联系电话">联系电话</th>
                            <th title="客户年龄">客户年龄</th>
                            <th title="客户状态">客户状态</th>
                            <th title="名单状态">名单状态</th>
                            <th title="所属顾问">所属顾问</th>
                            <th title="录入日期">录入日期</th>
                            <th title="最后跟进日期">线索转入时间</th>
                            <th title="最后跟进日期">最后跟进日期</th>
                            <th title="当前操作者Id">操作人</th>
                        </tr>
                        </thead>
                        <tbody>
                        <#if page_bean.list?size==0>
                            <tr>
                                <td align="center">无数据</td>
                            </tr>
                        </#if>
                        <#list page_bean.list as data>
                            <tr>
                                <td class="checkboxColumnTd">
                                    <div class="checkbox">
                                        <label>
                                            <input type="checkbox" class="chk" name="id" value="${data.id}">
                                            <span class="text"></span>
                                        </label>
                                    </div>
                                </td>
                                <td>${data_index+1+(page_bean.pageNo-1)*page_bean.pageSize}</td>
                                <td align="center">
                                    <!--<a class="icon-only  update" href="javascript:void(0);"-->
                                       <!--serializeNum="${serializeNum}" editUrl="${editUrl}" targetDataId="${data.id}"-->
                                       <!--title="编辑">修改</a>-->
                                    <@hp code="KHMD24277389291454-memerbetAdd"
                                    params="[serializeNum=${serializeNum},targetDataId=${data.id},targetName=${data.name}]"/>

                                    <#if data.listStatus==1>
                                        <@hp code="KHMD24277389291454-allocationAdd"
                                        params="[serializeNum=${serializeNum},targetDataId=${data.id},targetName=${data.name}]"/>
                                    </#if>

                                    <@hp code="KHMD24277389291454-depositAdd"
                                    params="[serializeNum=${serializeNum},targetDataId=${data.id}]"/>

                                    <@hp code="KHMD24277389291454-list_follow_up"
                                    params="[serializeNum=${serializeNum},stuStatus=${data.stuStatus}]"/>
                                </td>
                                <td serializeNum="${serializeNum}" class="detailTd" style="color: #2679b8;cursor: pointer"
                                    targetdataId="${data.id}" flag="1">
                                    ${(data.name???string(data.name?html,""))!''}
                                </td>
                                <td>${(data.nickName???string(data.nickName?html,""))!''}</td>
                                <td>${(data.contactPhone???string(data.contactPhone?html,""))!''}</td>
                                <td class="age">${(data.age???string(data.age?html,""))!''}</td>
                                <td> <@dictionary groupCode="stuStatus" dictionaryCode="${data.stuStatus}" ;stuStatus>${stuStatus.value }</@dictionary></td>
                                <td> <@dictionary groupCode="listStatus" dictionaryCode="${data.listStatus}" ;listStatus>${listStatus.value }</@dictionary></td>
                                <td>${(data.empRealName???string(data.empRealName?html,""))!''}</td>
                                <td>${(data.createTime???string(data.createTime?html,""))!''}</td>
                                <td>${(data.allocationTime???string(data.allocationTime?html,""))!''}</td>
                                <td>${(data.followUpTime???string(data.followUpTime?html,""))!''}</td>
                                <td>${(data.userName???string(data.userName?html,""))!''}</td>
                            </tr>
                        </#list>
                        </tbody>
                    </table>
                </div>
                ${pagingBar}
            </div>
        </div>
    </div>
</div>
<script>
    $(".selectpicker").select2();

    var age = $(".age");
    for (var i = 0; i < age.length; i++) {
        var ageHtml = age.eq(i).html();
        var newAgeHtml = ageHtml * 12;
        age.eq(i).html(Math.round(newAgeHtml))
        if(age.eq(i).html() == 0){
            age.eq(i).html()
        } else if (age.eq(i).html() > 12) {
            var year = parseInt(age.eq(i).html() / 12);
            var month = parseInt(age.eq(i).html() % 12);
            if (month == 0) {
                age.eq(i).html(year + '年')
            } else {
                age.eq(i).html(year + '年' + month + '月')
            }
        } else {
            age.eq(i).html(Math.round(newAgeHtml) + '月')
        }
    }


    /**
     * 新建
     * @param that
     */
    function showDialogAddStudent(that) {
        var serializeNum = $(that).attr("serializeNum");
        ajaxRequest("tssStudentController/toEditView.do", {
            serializeNum: serializeNum,
        }, function (html) {
            getTopWin().bootbox.dialog({
                message: html,
                title: "新增客户名单",
                className:"myDialog tssStudentEditDialog"
            });
            $(".modal-header").find(".bootbox-close-button").removeClass("close");
            $(".modal-header").find(".bootbox-close-button").html("");
        }, function () {
            ajaxError("加载页面失败!")
        }, "get", "html")


    }

    /**
     * 转会员
     * @param that
     */
    function showAddDialog(that) {
        var flag = "2";
        var targetdataid = $(that).attr("targetdataid");
        var targetName = $(that).attr("targetName");
        var serializeNum = $(that).attr("serializeNum");
        ajaxRequest("tssPaymentController/toAddedPaymentView.do", {
            flag: flag,
            serializeNum: serializeNum,
            targetdataid: targetdataid,
            other:1
        }, function (html) {
            getTopWin().bootbox.dialog({
                message: html,
                title: "亲子课时包",
                className: 'myDialog '
            });
            $(".modal-header").find(".bootbox-close-button").removeClass("close");
            $(".modal-header").find(".bootbox-close-button").html("");
        }, function () {
            ajaxError("加载页面失败!")
        }, "get", "html")
    }

    /**
     * 分配
     * @param that
     */
    function showAllocationAddDialog(that) {
        var serializeNum = $(that).attr("serializeNum");
        var targetdataId = $(that).attr("targetdataid");
        ajaxRequest("tssAllocationController/toEditView.do", {
            serializeNum: serializeNum,
            targetDataId: targetdataId
        }, function (html) {
            getTopWin().bootbox.dialog({
                message: html,
                title: "客户分配",
                className: 'myDialog tssStudentModal'
            });
            $(".modal-header").find(".bootbox-close-button").removeClass("close");
            $(".modal-header").find(".bootbox-close-button").html("");
        }, function () {
            ajaxError("加载页面失败!")
        }, "get", "html")

    }

    /**
     * 付订金
     * @param that
     */
    function showDepositAddDialog(that) {
        var flag = "1";
        var serializeNum = $(that).attr("serializeNum");
        var targetdataid = $(that).attr("targetdataid");
        console.log("targetdataid:"+targetdataid);
        ajaxRequest("tssPaymentController/toAddedPaymentView.do", {
            flag: flag,
            serializeNum: serializeNum,
            targetdataid: targetdataid,
            other:1
        }, function (html) {
            getTopWin().bootbox.dialog({
                message: html,
                title: "客户付订金",
                className: 'myDialog tssStudentModal'
            });
            $(".modal-header").find(".bootbox-close-button").removeClass("close");
            $(".modal-header").find(".bootbox-close-button").html("");
        }, function () {
            ajaxError("加载页面失败!")
        }, "get", "html")

    }


    /**
     * 分配
     * @param that
     */
    function showAllocationAddDialogs(that) {
        var checkedIds = getCheckedInputValues();
        var params = {};
        var serializeNum = $(that).attr("serializeNum");
        //  var targetdataId = $(that).attr("targetdataid");
        if (checkedIds) {
            params = {serializeNum: serializeNum, targetDataId: checkedIds}
        } else {
            alert("请选择要分配的客户!");
            return;
        }
        ajaxRequest("tssAllocationController/toEditView.do", {
            serializeNum: serializeNum,
            targetDataId: checkedIds
        }, function (html) {
            getTopWin().bootbox.dialog({
                message: html,
                title: "客户付定金",
                className: 'myDialog tssStudentModal'
            });

        }, function () {
            ajaxError("加载页面失败!")
        }, "get", "html")

    }

    /**
     * 全选反选
     * */
    function chkAll(){
        var ids;
        $("[name='id']").each(function(){
            if($(this).attr("checked", true)){
                $(this).attr("checked", false);
            } else{
                $(this).attr("checked", true);
            }
        });
    }

    /**
     * 导出数据
     * @param formId 条件表单id
     * @param templateName 导出的文件名
     */
    function exportData(that, templateName) {
        var params = $(that).attr("searchFormId");
        var exportIframe = ' <iframe class="hidden" id="exportIframe" name="exportIframe"></iframe>';
            var exportSrc ="tssStudentController/exportExcle.do";
            var $exportForm = $('<form method="post" target="exportIframe" action="' + exportSrc + '" id="exportForm"></form>');
            $("#" + formId).find("input").map(function (i, input) {
                var $input = $(input);
                var name = $input.attr("name");
                var val = $input.val();
                if (name) {
                    $exportForm.append('<input type="hidden" name="' + name + '" value="' + val + '">');
                }
            });
            $exportForm.append('<input type="hidden" name="ids" value="' + getCheckedInputValues() + '">');
            $exportForm.append('<input type="hidden" name="templateName" value="' + templateName + '">');
            $exportForm.append('<input type="hidden" name="loginAdminUserId" value="${loginUserId}">');

            var flag = 0;
            var name = $("[name='name']").val();
            var contactPhone = $("[name='contactPhone']").val();
            var empId = $("[name='empId']").val();
            if(name != ""){
                $exportForm.append('<input type="hidden" name="name" value="${search_map.name[0]}">');
                flag = 1;
            }
            if(contactPhone != ""){
                $exportForm.append('<input type="hidden" name="contactPhone" value="${search_map.contactPhone[0]}">');
                flag = 1;
            }
            if(empId != ""){
                $exportForm.append('<input type="hidden" name="empId" value="${search_map.empId[0]}">');
                flag = 1;
            }
                $exportForm.append('<input type="hidden" name="flag" value='+flag+'>');

        $("body #exportIframe").remove();
            $("body #exportForm").remove();
            $("body").append(exportIframe);
            $("body").append($exportForm);
            $exportForm.submit();
    };
    /**
     * 获取会员详情
     * @param that
     */
    $("#tableScrollable").on("click",".detailTd",function () {
        var serializeNum = $(this).attr("serializeNum");
        var targetdataId = $(this).attr("targetDataId");
        var flag = $(this).attr("flag");
        ajaxRequest("tssStudentController/getMemberDetailById.do", {
            serializeNum: serializeNum,
            memberId: targetdataId,
            type: 0,
            flag: flag
        }, function (html) {
            getTopWin().bootbox.dialog({
                message: html,
                title: "客户详情",
                className: 'myDialog tssStudentDetail'
            });
            $(".modal-header").find(".bootbox-close-button").removeClass("close");
            $(".modal-header").find(".bootbox-close-button").html("");
        }, function () {
            ajaxError("加载页面失败!")
        }, "get", "html")
    })

    /**
     * 添加跟进记录
     * @param that
     */
    function showAddMemberFollowUpRecord(that) {
        var serializeNum = $(that).attr("serializeNum");
        var stuStatus = $(that).attr("stuStatus");
        var targetdataId = $(that).attr("targetdataid");
        ajaxRequest("tssMemberFollowUpRecordController/toEditView.do", {
            serializeNum: serializeNum,
            targetDataId: targetdataId,
            stuStatus:stuStatus
        }, function (html) {
            getTopWin().bootbox.dialog({
                message: html,
                title: "客户跟进",
                className: 'myDialog tssStudentModal'
            });
            $(".modal-header").find(".bootbox-close-button").removeClass("close");
            $(".modal-header").find(".bootbox-close-button").html("");

//            $(".modal-header").append("<button type='button' class='bootbox-expand-button expand'  onclick='expandView()'></button>")
        }, function () {
            ajaxError("加载页面失败!")
        }, "get", "html")
    }


    /**
     * 导入excel
     * 杨然
     * */
    function inportExcle(){

        ajaxRequest("tssStudentController/Jump.do", {
        }, function (html) {
            getTopWin().bootbox.dialog({
                message: html,
                title: "数据导入",
                className: 'myDialog inportExcleDialog'
            });
            $(".modal-header").find(".bootbox-close-button").removeClass("close");
            $(".modal-header").find(".bootbox-close-button").html("");
        }, function () {
            ajaxError("加载页面失败!")
        }, "get", "html")
    }
//    隐藏显示搜索
    function iconsChange() {
        if($(".iconsChangeA").val()==1){
            $(".iconsChangeA").val("0");
            $(".iconsChangeA").css("background","url('assets/img/nav-img/icon_hidden.png')");
            $(".iconsChangeSpan").html("隐藏搜索栏");
            $(".search_Bar").removeClass("hidden");
        }else{
            $(".iconsChangeA").val("1");
            $(".iconsChangeA").css("background","url('assets/img/nav-img/icon_show.png')");
            $(".iconsChangeSpan").html("显示搜索栏");
            $(".search_Bar").addClass("hidden");
        }
    }

//    筛选下拉框
    setTimeout(function () {
        var size = $(".search_Bar_item").size();
        if (size > 8) {
            $(".iconchange1").removeClass("hidden");
            $(".search_Bar_item").each(function () {
                var index = $(this).index();
                if (index <= 8) {
                    $(this).removeClass("hidden")
                }

            })
        } else {
            $(".iconchange1").addClass("hidden");
            $(".search_Bar_item").each(function () {
                $(this).removeClass("hidden")
            })
        }

    }, 10)

    function iconchangeShow(that) {

        if($(that).attr("value")==1){
            $(that).attr("value","0");
            $(".iconchange1 .fa").removeClass("fa-chevron-down").addClass("fa-chevron-up");
            $(".search_Bar_item").each(function () {
                $(this).removeClass("hidden")
            })
        }else{
            $(that).attr("value","1");
            $(".iconchange1 .fa").removeClass("fa-chevron-up").addClass("fa-chevron-down");
            $(".search_Bar_item").each(function () {
                var index = $(this).index();
                if (index <= 8) {
                    $(this).removeClass("hidden")
                }else{
                    $(this).addClass("hidden")
                }

            })
        }

    }
</script>
<script>
    $(function(){
        ajaxRequest("sysAdminUserController/getPostListByDuty.do",{
            duty:1
        }, function (result) {
            var data=result.data;
            var arr=['']; //<option value="0">请选择</option>
            for (var i = 0; i< data.length; i++) {
                arr.push('<option value="'+data[i].id+'">'+data[i].realName+'</option>')
            }
            $("#realName").append(arr.join(''))
        },function(){
            ajaxError("加载员工信息失败");
        }, "post","json")
    });
    $(".selectpicker_${serializeNum}").select2();
    $("#editForm_${serializeNum}").bind("ajaxSubmitCallback", function (event, result) {
        if (result.resCode == 200) {
            bootbox.hideAll();
        }
    });
</script>


